package com.ctshk.common.enums.hotel;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 谢诗宏
 * @description 旅客类型
 * @date 2021/4/27
 */
@AllArgsConstructor
public enum TouristType {

    ADULT(1, "成人"),
    CHILD(2, "小童"),
    ;

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String value;

    public static String parseValue(int code){
        for (TouristType type : TouristType.values()) {
            if (type.code == code) {
                return type.getValue();
            }
        }
        return null;
    }
}
